import os
from pathlib import Path

from dotenv import load_dotenv


dotenv_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir, '.env'))
if os.path.exists(dotenv_path): load_dotenv(dotenv_path)

USER_DB = os.getenv('USER_DB')
PASSWORD_DB = os.getenv('PASSWORD_DB')
HOST_DB = os.getenv('HOST_DB')
NAME_DB = os.getenv('NAME_DB')

class Config(object):
    DEBUG = True

    SECRET_KEY = os.getenv('SECRET_KEY')

    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_DATABASE_URI = f'postgresql://{USER_DB}:{PASSWORD_DB}@{HOST_DB}/{NAME_DB}'
